package com.springapp.controller;

/**
 * Created by nicol_000 on 14/03/14.
 */


import com.springapp.connexion.SessionBean;
import com.springapp.service.impl.CommandeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.servlet.ModelAndView;


@Controller
@RequestMapping(value="/listeCommande")
     public class ControlAllCmdByRef {
    @Autowired
    private CommandeService listeCommandeByStatusByUsersService;
    @Autowired
    private SessionBean sessionBean;
    @RequestMapping(method = RequestMethod.GET)
    public ModelAndView displayList() {


        ModelAndView model = new ModelAndView("listeCommandeByStatutByUsers");
        model.addObject("lstCmd", listeCommandeByStatusByUsersService.getLstCmd(sessionBean.getUtilisateurFromSession().getsLogin()));
        return model;
    }
}
